﻿<Window x:Class="ExceptionMessageBoxLibrary.ExceptionMessageBoxView"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    Title="{Binding Caption}" SizeToContent="Height" Width="450" ShowInTaskbar="False" ResizeMode="NoResize" Closing="Window_Closing" >   
    <Grid Name="Image" Margin="5">
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="80" />
            <ColumnDefinition Width="*" />
        </Grid.ColumnDefinitions>
        <Grid.RowDefinitions>
            <RowDefinition Height="90" />            
            <RowDefinition Height="Auto" />
        </Grid.RowDefinitions>
        
        <Image Name="imageError" Stretch="Fill" Source="/ExceptionMessageBox;component/Resources/Images/error.png" Height="32" Width="32" Margin="0,25,0,0" VerticalAlignment="Top"/>

        <TextBlock Grid.Column="1" HorizontalAlignment="Left" VerticalAlignment="Center" Margin="2" Name="messageTextBlock" TextWrapping="Wrap" TextTrimming="CharacterEllipsis" Text="{Binding UserMessage}" />

        <Expander Grid.ColumnSpan="2" Grid.Row="1" Header="Details" VerticalAlignment="Top" HorizontalAlignment="Left" Margin="0" Name="showDetailExpander" >
            <Grid Margin="0,4,0,0" Height="200">
                <TextBox Grid.Row="2" Grid.ColumnSpan="2" HorizontalScrollBarVisibility="Visible" VerticalScrollBarVisibility="Visible"
                 Margin="0" Name="exceptionTextBlock" Text="{Binding ExceptionDetail}" IsReadOnly="True" AcceptsReturn="True" />
            </Grid>
        </Expander>

        <StackPanel Grid.Row="1" Grid.Column="1" VerticalAlignment="Top" Orientation="Horizontal" HorizontalAlignment="Right" Height="26" Margin="0">
            <Button Grid.Row="1" Grid.Column="1" Name="okButton" Content="OK" Width="74" Height="22" Margin="2" Visibility="{Binding OKVisibility}" Click="okButton_Click"></Button>
            <Button Grid.Row="1" Grid.Column="1" Name="yesButton" Content="Yes" Width="74" Height="22" Margin="2" Visibility="{Binding YesVisibility}" Click="yesButton_Click"></Button>
            <Button Grid.Row="1" Grid.Column="1" Name="noButton" Content="No" Width="74" Height="22" Margin="2" Visibility="{Binding NoVisibility}" Click="noButton_Click"></Button>
            <Button Grid.Row="1" Grid.Column="1" Name="cancelButton" Content="Cancel" Width="74" Height="22" Margin="2" Visibility="{Binding CancelVisibility}" Click="cancelButton_Click"></Button>
        </StackPanel>  
        
    </Grid>
</Window>
